const express = require("express");
// 引入文件上传模块
var fileUpload = require("express-fileupload");
const cors = require("cors");
const router = require("./router");
const app = express();
app.use(cors());
// 使用文件上传模块
app.use(fileUpload());
// 资源静态托管
app.use("/img", express.static("img"));
app.use(express.urlencoded({ extended: false }));
app.use("/api", router);
app.listen(3000, () => {
  console.log("服务器启动了");
});
